import os
import pandas as pd

def merge_excel():
 path = r"C:\Users\Kevin\Desktop\test"
 os.chdir(path)  # 修改工作路径
 f=pd.ExcelFile('test.xlsx')
 #print(f.sheet_names)
 data = pd.DataFrame()
 for i in f.sheet_names:
     d = pd.read_excel('test.xlsx', sheet_name=i)
     data = pd.concat([data, d])
 #print(data.shape)
 #print(data)
 data.to_excel('test1.xlsx', index=False)

# test = pd.read_excel('test.xlsx', sheet_name=None)
# for i in test.keys():
#     print(i)
#print(test)
merge_excel()
